Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script to mass-update bot cache in all issues #2165

Merged
merged 7 commits into from
Feb 8, 2024
Merged

Conversation

iarspider
Copy link
Contributor

@smuzaffar for a single-use script, I see no reason to merge it. I will create and run Jenkins job after you review this.

@cmsbuild
Copy link
Contributor

cmsbuild commented Feb 6, 2024

A new Pull Request was created by @iarspider for branch master.

@smuzaffar, @iarspider, @cmsbuild, @aandvalenzuela can you please review it and eventually sign? Thanks.
@rappoccio, @sextonkennedy, @antoniovilela you are the release manager for this.
cms-bot commands are listed here

@cmsbuild
Copy link
Contributor

cmsbuild commented Feb 6, 2024

cms-bot internal usage

@smuzaffar
Copy link
Contributor

@iarspider , can you please automatically process all


cnt = 0

for issue in repo.get_issues():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why process all issues? I would suggest to only process PRsand sort the PRs for updated (https://docs.github.com/en/rest/pulls/pulls?apiVersion=2022-11-28#list-pull-requests)

bot_cache = load_bot_cache_local(comment_msg)
print(" Read bot cache from technical comment:", comment)
break
if bot_cache and ("commits" not in bot_cache):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we would like to stop if there is no bot cache ... right? We do not want to process over 40K PRs , we only want to process those PRs where we have old bot cache

file=f,
)

api_rate_limits(gh)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move it under the for loop i.e. call it for every PR you process.

@cmsbuild
Copy link
Contributor

cmsbuild commented Feb 7, 2024

Pull request #2165 was updated.

@smuzaffar
Copy link
Contributor

@iarspider , looks good. I would suggest to add --repo org/repo option so that if passed then it only process that one repository. Then I would suggest to run it for cms-data/L1Trigger-L1TCalorimeter and see how many PR it has process and for whcih it suggested bot-cache update?

@iarspider
Copy link
Contributor Author

iarspider commented Feb 7, 2024

The script can't find any PR to update bot cache in (among all repositories mentioned in this comment), but I don't see a flaw in the logic... Double-checking now. found the issue.

@cmsbuild
Copy link
Contributor

cmsbuild commented Feb 7, 2024

Pull request #2165 was updated.

@iarspider
Copy link
Contributor Author

In total, there are 6 PRs (all in cms-data) that need cache update.

@smuzaffar
Copy link
Contributor

can you please report those 6 PRs here?

@smuzaffar
Copy link
Contributor

cms-data PRs list looks good. what about cms-sw/cmsdist ?

@iarspider
Copy link
Contributor Author

I have found a flaw in the script. Here is a revised list of all PRs that needs to be updated:

cms-sw/cmsdist#8982
cms-sw/cmsdist#8973
#2163
#2162
#2160
#2159
#2156
cms-sw/root#198
cms-sw/root#196
cms-sw/root#197
cms-sw/root#192
cms-sw/root#195
cms-sw/root#194
cms-sw/root#193
cms-sw/root#191
cms-sw/root#190
cms-sw/cmssw-config#102
cms-sw/cmssw-config#101
cms-sw/cmssw-config#100
cms-sw/cmssw-config#98
cms-sw/cmssw-config#99
cms-sw/pkgtools#204
cms-sw/pkgtools#203
cms-sw/pkgtools#201
cms-sw/pkgtools#202
cms-sw/SCRAM#62
cms-sw/SCRAM#61
cms-sw/SCRAM#63
cms-sw/cmssw-osenv#13
cms-sw/cmssw-osenv#12
cms-sw/cms-git-tools#126
cms-sw/cms-git-tools#125
cms-sw/cms-common#10
cms-data/RecoEgamma-ElectronIdentification#28
cms-data/L1Trigger-L1TCalorimeter#26
cms-data/L1Trigger-L1TCalorimeter#25
cms-data/GeneratorInterface-EvtGenInterface#24
cms-data/RecoMET-METPUSubtraction#7
cms-data/Configuration-Generator#15
cms-data/RecoBTag-Combined#55
cms-data/RecoBTag-Combined#54
cms-data/RecoMuon-MuonIdentification#10
cms-data/PhysicsTools-NanoAOD#15
cms-data/RecoTauTag-TrainingFiles#13
cms-data/HeterogeneousCore-SonicTriton#4
cms-data/HeterogeneousCore-SonicTriton#3
cms-data/RecoTracker-MkFit#13
cms-data/RecoEcal-EgammaClusterProducers#5
cms-data/RecoEgamma-EgammaPhotonProducers#5
cms-data/SimCalorimetry-EcalEBTrigPrimProducers#1
cms-data/DataFormats-L1Scouting#2
cms-data/DataFormats-L1Scouting#1
cms-data/DataFormats-L1ScoutingRawData#2
cms-data/DataFormats-L1ScoutingRawData#1
cms-data/L1Trigger-L1CaloTrigger#1
cms-data/L1Trigger-L1TMuonEndCapPhase2#1
cms-externals/eigen-git-mirror#8

@cmsbuild
Copy link
Contributor

cmsbuild commented Feb 8, 2024

Pull request #2165 was updated.

@iarspider
Copy link
Contributor Author

iarspider commented Feb 8, 2024

I think the reason some PRs were missed is the following: for repos other than cms-sw/cmssw, code-check is not ran, so already-seen comment is created immediately, before the technical comment. But cache is still correctly stored in technical comment, because already-seen comment didn't exist when the process-pull-request script started.

@smuzaffar smuzaffar merged commit d23e08c into master Feb 8, 2024
3 of 4 checks passed
@iarspider iarspider deleted the mass-update-cache branch February 8, 2024 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants